package games.gameObjects.towers;

import gameUtils.Coordinate;
import games.gameObjects.ShootingType;
import games.gameObjects.SimpleTDObject;

/**
 * 
 * @author batata
 * This Class <<abstract>< represents a defensive shooting Tower
 */

public abstract class Tower extends SimpleTDObject {

	public static final String TD_CLASS = "Tower";
	private int damage, range, cost;
	private String name;

	/**
	 * Default Constructor Tower
	 * @param coordinate
	 * @param priority
	 */
	public Tower(final Coordinate coordinate, final int priority, final String name, 
			final int damage, final int range, final int cost){
		
		super(coordinate, priority);
		
		this.name = name;
		this.damage = damage;
		this.range = range;
		this.cost = cost;
	}

	
	/**
	 * The function returns the name of the tower
	 * @return the name
	 */
	public String getName(){
		return name;
	}

	/**
	 * Function that returns the damage value that 
	 * a tower can do
	 * @return
	 */
	public int getDamage() {
		return this.damage;
	}

	/**
	 * Function that returns the range of a Tower
	 * @return the range of a Tower
	 */
	public int getRange() {
		return this.range;
	}

	/**
	 * Return the vale of tower cost
	 * @return the value of tower cost
	 */
	public int getCost() {
		return this.cost;
	}

	/**
	 * String representation of Tower
	 */
	@Override
	public String toString(){
		return "tower:"+this.getName()+"\n"+
				"cost:"+this.getCost()+"\n"+
				"dmg:"+this.getDamage()+"\n"+
				"range:"+this.getRange()+"\n";
	}
	/**
	 * Function that returns the type of tower
	 * @return the tower type
	 */
	public abstract TowerType getTowerType();
	/**
	 * Function that returns the shooting type of
	 * a tower : Air, Land, Water
	 * @return shooting type
	 */
	public abstract ShootingType getShootingType();

	@Override
	public String getTDClass() {
		return TD_CLASS;
	}
	
	/**
	 * Tester of Tower
	 */
//	public static void main(String[] args) {
//
//		Tower1 o1 = new Tower1(new Coordinate(1,2));
//		Tower2 o2 = new Tower2(new Coordinate(1,2));
//
//		System.out.println(o1);
//		Invader i = new Bug(new Coordinate(2,3),1);
//		System.out.println(i);
//		o1.shootAtUnit(i);
//		System.out.println(i);
//
//	}
}
